﻿using B.S.BaseData.Api.Read.Command.HospitalCommand;
using B.S.BaseData.ErrorCode;
using B.S.BaseData.Infrastructure.Interface;
using B.S.BataBase.Domain.AI;
using MediatR;

namespace B.S.BaseData.Api.Read.CommandHandler.HospitalCommandHandler
{
    public class HistoryOfMedicalVisitsFTCommandHandler : IRequestHandler<HistoryOfMedicalVisitsFTCommand, APIResult<HistoryOfMedicalVisitsModel>>
    {
        private readonly IBaseRepository<HistoryOfMedicalVisitsModel> _baseRepository;
        public HistoryOfMedicalVisitsFTCommandHandler(IBaseRepository<HistoryOfMedicalVisitsModel> baseRepository)
        {
            _baseRepository = baseRepository;
        }
        public async Task<APIResult<HistoryOfMedicalVisitsModel>> Handle(HistoryOfMedicalVisitsFTCommand request, CancellationToken cancellationToken)
        {
            APIResult<HistoryOfMedicalVisitsModel> result = new APIResult<HistoryOfMedicalVisitsModel>();
            var list = await _baseRepository.GetValues(x => x.Id == request.Id);
            result.Data = list;
            result.Code = ApiEnum.Success;
            result.Msg = "支付信息回显成功";
            return await Task.FromResult(result);
        }
    }
}
